Hope my earlier explanation about object is understood to everyone.
Now, i am going to discuss next about classes.
let us take e.g. from real world i.e. Car. here, car has many types but kind is same.All of the same make and model.
Each Car is made of same prototype or blueprint and therefore, contains same components.
In OOPS, we can say car is an instance of the class of the objects knows as"CARS".
So, class is the prototype from which individual objects are created.
I repeat my earlier e.g. over here i.e. class car which i posted in earlier post.
i just want to explain that the field cadence, speed, gear , music system volume all represents the state & the method change cadence, change gear, change speed, change volume defines its interaction from outside world.
Here, you may noticed that car doesn't contain a main method, that is because it just a prototype not a complete application.
In next post i will explain this prototype with e.g.
ANkita gupta
30-Apr-2015Anonymous User
30-Apr-2015As per Student class implementation here is a simple sample for your learning:
Student Class:
StudentTest Class:
O/P:
Ravi is writing Stories
Ravi is reading Newspapaer
Ravi is listening Pop
Ravi is 22 years old and studies in 12 class
Swati is writing Poems
Swati is reading English
Swati is listening Rock
Swati is 18 years old and studies in 10 class
Hope this will help you understand classes and communication between object and class members!!
ANkita gupta
30-Apr-2015Anonymous User
30-Apr-2015ANkita gupta
30-Apr-2015ANkita gupta
30-Apr-2015ANkita gupta
30-Apr-2015Anonymous User
29-Apr-2015ANkita gupta
29-Apr-2015Anonymous User
29-Apr-2015